<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
  mixins: [
    Vue.prototype.$vFN.Mixins.Base,
    Vue.prototype.$vFN.Mixins.Edit,
    Vue.prototype.$vFN.Mixins.List,
  ],
  components: {},
  data() {
    return {
      appWindow: window,
      // 页面接口地址
      apiUrl: {
        list: "api/coupon/pageMemberCoupon",
      },
      // 请求携带参数
      mixinList_tableSearchConst: {
        couponId: "",
      },

      // 表格数据删除展示结构
      tableDeleteConfig: {
        width: "400px",
        title: "确定删除?",
        columns: [
          {
            label: "商品名称",
            prop: "productName",
            type: "",
          },
        ],
      },
    };
  },
  methods: {
    // 初始化
    async init() {
      // 请求第一页
      this.mixinList_tableSearchConst.couponId = Number(this.couponId);
      console.log("2");
      this.mixinList_getTable();
      // 显示
      this.mixinEdit_editVisible = true;
    },

    typeNum2Text(num) {
      let text = "";
      switch (num) {
        case 1:
          text = "代金券";
          break;
        case 2:
          text = "折扣券";
          break;
        case 3:
          text = "兑换券";
          break;
      }
      return text;
    },

    statusNum2Text(num) {
      let text = "";
      switch (num) {
        case 1:
          text = "未使用";
          break;
        case 2:
          text = "已锁定";
          break;
        case 3:
          text = "已使用";
          break;
        case 4:
          text = "已过期";
          break;
        case 5:
          text = "已作废";
          break;
      }
      return text;
    },
  },
  mounted() {
    this.init();
  },
  activated() {},
};
</script>
